﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bzure.Security.Principal;
using Bzure.Common.Transactions;

namespace Bzure.Apps.Security
{
    public interface IUserContract : ITransactionSupport
    {
        /// <summary>
        /// 获取所有用户
        /// </summary>
        /// <returns></returns>
        BzureUser[] GetAllUsers();
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userid"></param>
        bool DeleteUserByID(string userid);
        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        BzureUser GetUserByID(string userid);
        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="EMail"></param>
        /// <returns></returns>
        BzureUser GetUserByEMail(string EMail);
        /// <summary>
        /// 根据绑定获得用户
        /// </summary>
        /// <param name="BindID"></param>
        /// <param name="BindProvider"></param>
        /// <returns></returns>
        BzureUser GetUserByBind(string BindID, string BindProvider);
        /// <summary>
        /// 通过用户ID组获取用户组
        /// </summary>
        /// <param name="Ids"></param>
        /// <returns></returns>
        BzureUser[] GetUsers(string[] Ids);
        /// <summary>
        /// 创建用户ID
        /// </summary>
        /// <returns></returns>
        string GenerateUserID();
        /// <summary>
        /// 创建角色ID
        /// </summary>
        /// <returns></returns>
        string GenerateRoleID();
        /// <summary>
        /// 昵称是否存在
        /// </summary>
        /// <param name="NickName"> 昵称</param>
        /// <returns></returns>
        bool ExistsNickName(string NickName);
        /// <summary>
        /// 验证用户
        /// </summary>
        /// <param name="EMail"></param>
        /// <param name="EncryptPassword"></param>
        /// <returns></returns>
        bool ValidateEMailUser(string EMail, string EncryptPassword);
        /// <summary>
        /// 邮箱是否存在
        /// </summary>
        /// <param name="NickName"> 邮箱</param>
        /// <returns></returns>
        bool ExistsEMail(string EMail);
        /// <summary>
        /// 设置昵称
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <param name="NickName">昵称</param>
        /// <returns></returns>
        bool SetNickName(String UserName, string NickName);
        /// <summary>
        /// 获取总用户数
        /// </summary>
        /// <returns></returns>
        long GetAllUserCount();
    }
}
